// interface 重名会合并
// interface  任意key
//接口继承 

interface Person extends B,C{     //extends继承B,C(多继承)
    name:string,
    age?:number,       //可选
    readonly cb:()=>boolean     //只读  id,函数
    [propName:string]:any       
}

interface B{
    xxx:string
}
interface C{
    yyy:string
}

let a:Person = {
    name:'张三',
    age:18,
    cb:()=>true,
    xxx:'1',
    yyy:'2'
}
console.log(a)

interface Fn{   //定义函数接口，传入string参数，返回一个number数组
    (name:string):number[]
}
const fn:Fn = function(name:string){
    return [0]
}